From: Mark A. Hershberger Date: Wed, 14 Apr 2010 04:57:27 +0000 (+0000) Subject: * EOL ws clean on ApiBase.php X-Git-Tag: 1.31.0-rc.0~37120 X-Git-Url: http://git.cyclocoop.org//%22http:/%22.attribut_html%28%24lesurls%5B%24numero%5D%29.%22/%22?a=commitdiff_plain;h=e90d1ecd975e5afb097d94fe91eaecc1ff816346;p=lhc%2Fweb%2Fwiklou.git * EOL ws clean on ApiBase.php * Use an actual value for ApiUpload.php * Commit some code I must've missed for r64852 --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index b90b0be28f..4aeac9aa9d 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -551,7 +551,7 @@ abstract class ApiBase { case 'preferences': global $wgUser; - if ( isset($titleObj) && !$titleObj->userIsWatching() ) { + if ( isset($titleObj) && !$titleObj->userIsWatching() ) { if ( $titleObj->exists() ) { if ( $wgUser->getOption( 'watchdefault' ) ) { return true; diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index 421744f793..4cdf34743a 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -81,16 +81,8 @@ class ApiUndelete extends ApiBase { wfRunHooks( 'FileUndeleteComplete', array( $titleObj, array(), $wgUser, $params['reason'] ) ); } - - $watch = $this->getWatchlistValue( $params['watchlist'], $titleObj ); - - if ( $watch !== null ) { - if ( $watch ) { - $wgUser->addWatch( $titleObj ); - } else { - $wgUser->removeWatch( $titleObj ); - } - } + + $this->setWatch( $params['watchlist'], $titleObj ); $info['title'] = $titleObj->getPrefixedText(); $info['revisions'] = intval( $retval[0] ); diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index f81ea24cff..2ff58f8629 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -248,7 +248,7 @@ class ApiUpload extends ApiBase { } $file = $this->mUpload->getLocalFile(); - $watch = $this->getWatchlistValue( $params['watchlist'], $file->getTitle() ); + $watch = $this->getWatchlistValue( $this->mParams['watchlist'], $file->getTitle() ); // Deprecated parameters if ( $this->mParams['watch'] ) {